import { useEffect } from 'react';
import { useNavigate } from 'react-router';
import { useCustomerState } from './stores/CustomerStore.ts';

function App() {
  const { customerName } = useCustomerState();
  const navigate = useNavigate();
  useEffect(() => {
    if (customerName === '') {
      navigate('/login');
    } else {
      navigate('/customer');
    }
  }, [customerName, navigate]);
  return <></>;
}

export default App;
